from flask import *
import base64

app = Flask(__name__)


@app.route('/json')
def jsonTest():
    data = {
        "result": "hello world",
        "class": {
            "date": 2022,
            "time": 12.5
        }
    }
    print(jsonify(data))
    return jsonify(data)


@app.route('/imgTest')
def imgTest():
    queryNo = request.args.get('picID')
    #imgPath = 'D:/tmp/img/' + queryNo + '.jpg'
    imgPath = 'D:/COLOR/' + queryNo + '.png'
    print(imgPath)
    return send_file(imgPath)

if __name__ == '__main__':
    app.run()
